package com.lingyuan.product.controller;

import com.lingyuan.common.core.domain.R;
import com.lingyuan.product.domain.AttrEntity;
import com.lingyuan.product.service.AttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName AttrController
 * @Description 描述 属性控制层
 * @Author guoxin
 * @Date 2024/9/19 19:39
 */
@RestController
@RequestMapping("/attr")
public class AttrController {
    @Autowired
    private AttrService attrService;
    /**
     * 根据分类id区分属性
     */
    @GetMapping("/attrList")
    public R attrList(Long catelogId){
        List<AttrEntity> list = attrService.attrList(catelogId);
        return R.ok(list);
    }
}
